<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>

    </div>
    <script>
        function dragCircle(x1,y1,x2,y2){//拖出一个圆来
            var r=Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));//求出半径的长 直角三角形中 斜边的平方=两个直边的平方之和
            var frag=document.createDocumentFragment();
            for(var degree=0;degree<360;degree+=2){//每隔2度画一个点
                var x2=r*Math.sin(degree*Math.PI/180);
                var y2=r*Math.cos(degree*Math.PI/180);
                frag.appendChild(point(x1+x2,y1+y2));
            }
            document.getElementById('div1').appendChild(frag);
            }
    </script>
</body>
</html>